package genetic.q3;


import genetic.Genotype;

import java.util.Arrays;

public class CliqueGenotype implements Genotype{

	public boolean[] instance;

	public CliqueGenotype(boolean[] instance){
		this.instance = instance;
	}

	public CliqueGenotype clone(){
		return new CliqueGenotype(Arrays.copyOf(instance, instance.length));
	}

	@Override
	public String toString() {
		String ans = "[";
		for (int i=0; i<instance.length; i++){
			if(instance[i]){
				ans = ans+i + ",";
			}
		}
		if (ans.length()>2) ans = ans.substring(0, ans.length()-1);
		return ans+"]";
	}

	@Override
	public boolean[] getBitString() {
		return instance;
	}

}
